﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="Search.aspx.cs" Inherits="SharingCenter.Web.Admin.Events.Search" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    活动搜索
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManagerProxy runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Admin/Events/Event.js" />
        </Scripts>
    </asp:ScriptManagerProxy>
<myuc:GenericTabs ID="GenericTabs1" runat="server" Section="AdminEvents" SelectedItem="3" />
    <h2 class="w5">
        活动搜索</h2>
    <div>
        <table>
            <tr>
                <td>
                    关键字：
                </td>
                <td>
                    <asp:TextBox CssClass="sk" runat="server" MaxLength="20" ID="txtKeyword"></asp:TextBox>
                    <span>(按照活动标题搜索)</span>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:LinkButton CssClass="button" runat="server" ID="btnSearch">搜索</asp:LinkButton>
                </td>
            </tr>
        </table>
    </div>
    <asp:Panel runat="server" Visible="false" ID="pnResult">
        <h3 class="w4">
            搜索结果</h3>
        <asp:ListView ID="ListView1" runat="server" DataKeyNames="EventId">
            <ItemSeparatorTemplate>
                <tr>
                    <td colspan="10"><div class="hr1"></div></td>
                </tr>
            </ItemSeparatorTemplate>
            <ItemTemplate>
                <tr class="eventitem">
                    <td>
                        <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("Title") %>' NavigateUrl='<%#Eval("EventId", "~/Mod/Events/?id={0}") %>' />
                        <asp:Label ID="CategoryLabel" CssClass="litetext" runat="server" Text='<%# Eval("Category", "({0})") %>' />
                    </td>
                    <td>
                        <asp:Label ID="StartDateLabel" runat="server" Text='<%# Eval("StartDate", "{0:yyyy年M月d日 HH:mm}") %>' />
                    </td>
                    <td>
                        <asp:Label ID="EndDateLabel" runat="server" Text='<%# Eval("EndDate", "{0:yyyy年M月d日 HH:mm}") %>' />
                    </td>
                    <td>
                        <cc:AvatarImage CssClass="useravatar" AvatarType="Tiny" AlternateText="" Width="16"
                            UserId='<%#Eval("CreatorUserId") %>' runat="server" />
                        <cc:NickNameLink runat="server" UserId='<%#Eval("CreatorUserId") %>' />
                    </td>
                    <td>
                        <asp:Label ID="Sc_EventRequestsLabel" runat="server" Text='<%# Eval("TotalParticipants")+"/"+((int)Eval("MaxParticipants")>0?Eval("MaxParticipants"):"无限制") %>' />
                    </td>
                    <td>
                        <asp:HyperLink CssClass="deleteeventbutton pointer" runat="server" ImageUrl="~/Content/images/icons/cross1.png" ToolTip="删除" eid='<%#Eval("EventId") %>'></asp:HyperLink>
                        <asp:HyperLink CssClass="canceleventhotbutton hotbutton pointer" runat="server" ImageUrl="~/Content/images/icons/fire_on.png" ToolTip="取消热" eid='<%#Eval("EventId") %>' Visible='<%#Eval("IsHot") %>'></asp:HyperLink>
                        <asp:HyperLink CssClass="seteventhotbutton hotbutton pointer" runat="server" ImageUrl="~/Content/images/icons/fire_off.png" ToolTip="设置为热" eid='<%#Eval("EventId") %>' Visible='<%#!Convert.ToBoolean(Eval("IsHot")) %>'></asp:HyperLink>
                        <asp:HyperLink CssClass="canceleventrecbutton recbutton pointer" runat="server" ImageUrl="~/Content/images/icons/star_on.png" ToolTip="取消精华" eid='<%#Eval("EventId") %>' Visible='<%#Eval("IsRecommended") %>'></asp:HyperLink>
                        <asp:HyperLink CssClass="seteventrecbutton recbutton pointer" runat="server" ImageUrl="~/Content/images/icons/star_off.png" ToolTip="设置为精华" eid='<%#Eval("EventId") %>' Visible='<%#!Convert.ToBoolean(Eval("IsRecommended")) %>'></asp:HyperLink>
                    </td>
                </tr>
            </ItemTemplate>
            <EmptyDataTemplate>
                <myuc:MessageBox runat="server" MessageType="Generic" Text="目前没有任何活动。" />
            </EmptyDataTemplate>
            <LayoutTemplate>
                <table id="itemPlaceholderContainer" runat="server" border="0" class="tb-full">
                    <tr>
                        <th>
                            活动名称
                        </th>
                        <th>
                            开始日期
                        </th>
                        <th>
                            结束日期
                        </th>
                        <th>
                            发起人
                        </th>
                        <th>
                            参与/上限
                        </th>
                        <th></th>
                    </tr>
                    <tr id="itemPlaceholder" runat="server">
                    </tr>
                </table>
                <div class="actionarea textfar">
                    <asp:DataPager ID="DataPager1" runat="server" PageSize="20">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Link" FirstPageText="首页" ButtonCssClass="pager-f1 "
                                ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            <asp:NumericPagerField ButtonType="Link" NumericButtonCssClass="pager-n1 " CurrentPageLabelCssClass="pager-c" />
                            <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True" ShowNextPageButton="False"
                                ButtonCssClass="pager-l1 " ShowPreviousPageButton="False" LastPageText="末页" />
                        </Fields>
                    </asp:DataPager>
                </div>
            </LayoutTemplate>
        </asp:ListView>
    </asp:Panel>
</asp:Content>
